<?php
$route->any('login', 'AuthController@login')->name('admin.user.login');

$route->any('qiniu/callback', 'QiNiuController@callback');

$route->any('test', 'TestController@index');

$route->any('notify', 'TestController@notify');
$route->any('qiniu/token', 'QiNiuController@getToken');

//type
$route->get('type/index', 'TypeController@index')->name('admin.type.index');

$route->group(['middleware' => 'api.auth'], function ($route) {
    
    //管理员
    $route->get('admin/index', 'AdminController@index')->name('admin.admin.index');
    $route->get('logout', 'AdminController@logout')->name('admin.admin.logout');
    $route->post('admin/store', 'AdminController@store')->name('admin.admin.store');
    $route->post('password/update', 'AdminController@updatePwd')->name('admin.password.update');
    $route->any('permission', 'AuthController@permission');
    $route->any('reset/password', 'AdminController@resetPassword');
    $route->any('admin/destroy', 'AdminController@destroy');
    $route->any('admin/info', 'AdminController@info');

    //category
    $route->get('category/index', 'CategoryController@index');
    $route->get('category/info', 'CategoryController@info');
    $route->post('category/store', 'CategoryController@store');
    $route->post('category/destroy', 'CategoryController@destroy');

    //service
    $route->get('service/index', 'ServiceController@index');
    $route->post('service/store', 'ServiceController@store');
    $route->get('service/info', 'ServiceController@info');
    $route->post('service/edit/status', 'ServiceController@editStatus');
    $route->post('service/destroy', 'ServiceController@destroy');

    //appoint
    $route->get('appoint/index', 'AppointController@index');
    $route->get('appoint/index', 'AppointController@index');
    $route->any('appoint/edit/price', 'AppointController@edit_price');
    $route->any('appoint/offline/pay', 'AppointController@offline_pay');
    // order comment
    $route->any('order/comment', 'OrderCommentController@index');
    $route->any('order/comment/destroy', 'OrderCommentController@destroy');
    $route->any('order/comment/reply', 'OrderCommentController@store');

    //material
    $route->any('material/index', 'MaterialController@index');
    $route->any('material/destroy', 'MaterialController@destroy');
    $route->post('material/edit/status', 'MaterialController@editStatus');
    //素材订单
    $route->any('material/order', 'MaterialController@order');
    //work
    $route->any('work/index', 'WorkController@index');
    $route->post('work/edit/status', 'WorkController@editStatus');
    $route->any('work/destroy', 'WorkController@destroy');

    //设置
    $route->get('setting/info', 'ConfigController@info');
    $route->post('setting/store', 'ConfigController@store');

    //site
    $route->get('config/site', 'ConfigController@site')->name('admin.config.site');
    $route->post('config/site/update', 'ConfigController@update')->name('admin.config.site.update');

    //user
    $route->get('user/index', 'UserController@index');
    $route->post('user/edit/status', 'UserController@editStatus');

    //服务商
    $route->get('merchant/index', 'MerchantController@index');
    $route->post('merchant/edit/status', 'MerchantController@editStatus');

    //通知
    $route->get('notification/index', 'NotificationController@index');
    $route->any('notification/destroy', 'NotificationController@destroy');
    $route->post('notification/store', 'NotificationController@store');

    //vip order
    $route->get('vip/order', 'VipOrderController@index');

    //评论
    $route->get('comment/index', 'CommentController@index');
    $route->any('comment/destroy', 'CommentController@destroy');

    //banner
    $route->get('banner/index', 'BannerController@index')->name('admin.banner.index');
    $route->get('banner/info', 'BannerController@info')->name('admin.banner.info');
    $route->post('banner/store', 'BannerController@store')->name('admin.banner.store');
    $route->post('banner/destroy', 'BannerController@destroy')->name('admin.banner.destroy');


    //提现
    $route->any('withdraw/handle', 'WithdrawController@handle');
    $route->any('withdraw/index', 'WithdrawController@index');
    $route->any('withdraw/query', 'WithdrawController@query');

});

